﻿
@{
    ViewBag.Title = "添加管理员";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using Mate.Framework.Extensions
@model Mate.Dto.Users.AdminUserModel
@section styles{

}
@section scripts{
    <script src="~/bootstrap/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/bootstrap/plugins/jquery-validation/dist/additional-methods.min.js"></script>
    <script src="~/bootstrap/scripts/custom/form-validation.js" charset="gbk"></script>

    <script src="~/js/admin.js?v=1.0"></script>
    <script language="javascript" type="text/javascript">
    $(function () {
        var rules = {
            user_no: {
                required: true
            },
            user_name: {
                required: true
            },
            password: {
                required: true
            }
        };
        FormValidation.BasicValidation(rules);

    });
    </script>
}

    <ul class="page-breadcrumb breadcrumb">
        <li>
            <a href="@Url.Action("Index","AdminUser")">
                管理员管理
            </a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            添加管理员
        </li>
    </ul>

<div class="row">
    <div class="col-md-12">
        
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                @using (Html.BeginForm("Create", "AdminUser", FormMethod.Post, new { @class = "form-horizontal", @id = "form_ff_validation", @novalidate = "novalidate" }))
                {
                <div class="form-body">
                    @Html.TextFor("账号", "user_no")
                    @Html.TextFor("姓名", "user_name")
                    @Html.TextFor("登录密码", "password")
                    <div class="form-group">
                        <label class="control-label col-sm-3">
                            角色
                            <span class="required">*</span>
                        </label>
                        <div class="col-sm-4">
                            <select id="roles_id" name="roles_id" class="form-control">
                                @foreach (var item in Model.Roles)
                                {
                                    <option value="@item.id">@item.role_name</option>
                                }
                            </select>
                        </div>
                    </div>
                    @Html.SexSelectFor("性别", "sex",isSelect:false)
                    @Html.TextFor("手机号", "phone", required: false)
                    @Html.EnableRadioFor()
                </div>
                    <div class="form-actions fluid">
                        <div class="col-md-offset-3 col-md-9">
                            <button class="btn green" type="button" onclick="admin.AddSubmit('@Url.Action("Index")')"> 提交 <i class="fa fa-check"></i> </button>
                            <a class="btn default" role="button" href="@Url.Action("Index")"> 返回 <i class="fa fa-reply"></i></a>
                        </div>
                    </div>
                }
                <!-- END FORM-->
            </div>
        </div>
        <!-- END VALIDATION STATES-->
    </div>
